package com.principle.composite;

public class Client {
    public static void main(String[] args) {
        //从小到大创建对象
        OrganizationComponent university=new University("清华大学","中国顶级大学");
        //创建学院
        OrganizationComponent college1=new College("计算机学院","学计算机");
        OrganizationComponent college2=new College("信息工程学院","通信相关");
        //创建各个学院下面的系
        college1.add(new Department("软件工程","不错"));
        college1.add(new Department("网络工程","不错"));
        college1.add(new Department("计算机科学与技术","不错"));

        college2.add(new Department("通信工程","教好"));
        college2.add(new Department("信息工程","好"));

        university.add(college1);
        university.add(college2);
        university.print();
    }
}
